@echo off
set CLASSPATH="%CLASSPATH%"
call :add_jars_from_dir lib
call :add_jars_from_dir lib/everest

if "%1"=="ssl" (
  java -cp %CLASSPATH% -Djava.util.logging.config.file=conf/logging.properties websolve.workflow.wfms.Server conf/jetty-ssl.xml
) else (
  java -cp %CLASSPATH% -Djava.util.logging.config.file=conf/logging.properties websolve.workflow.wfms.Server conf/jetty.xml
)

:add_jars_from_dir
for %%f in (%1\*.jar) do (call :append_classpath %%f)
goto :eof

:append_classpath
set CLASSPATH=%CLASSPATH%;%1
goto :eof